package org.jflame.commons.crypto.digest;

/**
 * 消息摘要算法名枚举
 * 
 * @author charles.zhang
 */
public enum DigestAlg {

    MD2,
    MD5,
    SHA1("SHA-1"),
    SHA224("SHA-224"),
    SHA256("SHA-256"),
    SHA384("SHA-384"),
    SHA512("SHA-512"),
    SM3;

    private String name;

    private DigestAlg() {
    }

    private DigestAlg(String algorithmName) {
        name = algorithmName;
    }

    /**
     * 算法名称
     * 
     * @return
     */
    public String getName() {
        return name == null ? name() : name;
    }
}
